class FollowFansResponse {
  List<FollowFansItem> rows;
  int total;

  FollowFansResponse({
    required this.rows,
    required this.total,
  });

  factory FollowFansResponse.fromJson(Map<String, dynamic> json) =>
      FollowFansResponse(
        total: json['total'] as int,
        rows: (json['rows'] as List)
            .map((e) => FollowFansItem.fromJson(e))
            .toList(),
      );
}

class FollowFansItem {
  int? customerId;
  String? creatorName;
  String? creatorAvatar;
  bool unFollowed; // 已取消关注
  int? toEachFlag; // 是否互关：0.否；1.是
  String? followTime; // 关注时间
  int officialFlag;
  String? officialName;

  FollowFansItem({
    this.customerId,
    this.creatorName,
    this.creatorAvatar,
    this.toEachFlag = 0,
    this.unFollowed = false,
    this.followTime,
    this.officialFlag = 0,
    this.officialName,
  });

  factory FollowFansItem.fromJson(Map<String, dynamic> json) => FollowFansItem(
        customerId: json['customerId'] as int?,
        creatorName: json['creatorName'] as String?,
        creatorAvatar: json['creatorAvatar'] as String?,
        toEachFlag: json['toEachFlag'] as int?,
        followTime: json['followTime'] as String?,
        officialFlag: (json['officialFlag'] as int?) ?? 0,
        officialName: json['officialName'] as String?,
      );

  Map<String, dynamic> toJson() => {
        'customerId': customerId,
        'creatorName': creatorName,
        'creatorAvatar': creatorAvatar,
        'toEachFlag': toEachFlag,
        'followTime': followTime,
        'officialFlag': officialFlag,
        'officialName': officialName,
      };
}
